package com.example.demospringsecurity.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @GetMapping("/hello")
//    @PreAuthorize("hasAuthority('system:test:list')")
//    @PreAuthorize("hasRole('system:test:list')")
    @PreAuthorize("@ex.hasAuthority('system:test:list')")  //自定义权限校验方法
    public String hello() {
        return "hello";
    }
}
